<?php
/**
 * Created by PhpStorm.
 * User: jwb
 * Date: 2020/4/10
 * Time: 11:38
 */

namespace App\Inventor\Extensions\Column;


use Encore\Admin\Admin;
use Encore\Admin\Grid\Displayers\AbstractDisplayer;

class LayerModal extends AbstractDisplayer
{
    public function script($href)
    {
        return <<<EOT
 $('.grid-open-layer-frame').on('click', function(){
    layer.open({
      type: 2,
      title: 'iframe父子操作',
      maxmin: true,
      shadeClose: true, //点击遮罩关闭层
      area : ['800px' , '520px'],
      content: '{$href}'
    });
  });
EOT;

    }

    public function display($href='')
    {
        Admin::script($this->script($href));
        return <<<EOT
<a class="grid-open-layer-frame">{$this->getValue()}</a>
EOT;
        // TODO: Implement display() method.
    }


}